package com.extension.company.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class AddressListData implements Parcelable {


	/**
	 * code : 200
	 * msg : 获取成功
	 * time : 1563798707
	 * data : {"address":[{"id":2,"name":"测试1","phone":"12345678912","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"详细","user_id":1,"createtime":1563450910,"is_default":"0"},{"id":5,"name":"test","phone":"12345678912","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"详细","user_id":1,"createtime":1563451583,"is_default":"0"},{"id":6,"name":"测试数据","phone":"18314785236","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"详细地址","user_id":1,"createtime":1563451590,"is_default":"0"},{"id":7,"name":"123","phone":"12345678912","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"详细","user_id":1,"createtime":1563451762,"is_default":"0"},{"id":8,"name":"123","phone":"12345678912","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"详细","user_id":1,"createtime":1563451807,"is_default":"0"},{"id":10,"name":"测试","phone":"18312345678","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"帝都北京四合院","user_id":1,"createtime":1563453960,"is_default":"0"},{"id":11,"name":"测试","phone":"18312345678","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"帝都北京四合院","user_id":1,"createtime":1563453963,"is_default":"0"},{"id":12,"name":"仲3","phone":"15339922006","province_id":1,"city_id":2,"region_id":3,"pname":"北京","cname":"北京市","rname":"东城区","detail":"长虹路","user_id":1,"createtime":1563592286,"is_default":"1"}]}
	 */

	private int code;
	private String msg;
	private String time;
	private DataBean data;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public DataBean getData() {
		return data;
	}

	public void setData(DataBean data) {
		this.data = data;
	}

	public static class DataBean implements Parcelable {
		private List<AddressBean> address;

		public List<AddressBean> getAddress() {
			return address;
		}

		public void setAddress(List<AddressBean> address) {
			this.address = address;
		}

		public static class AddressBean implements Parcelable {
			/**
			 * id : 2
			 * name : 测试1
			 * phone : 12345678912
			 * province_id : 1
			 * city_id : 2
			 * region_id : 3
			 * pname : 北京
			 * cname : 北京市
			 * rname : 东城区
			 * detail : 详细
			 * user_id : 1
			 * createtime : 1563450910
			 * is_default : 0
			 */

			private int id;
			private String name;
			private String phone;
			private int province_id;
			private int city_id;
			private int region_id;
			private String pname;
			private String cname;
			private String rname;
			private String detail;
			private int user_id;
			private int createtime;
			private String is_default;

			public int getId() {
				return id;
			}

			public void setId(int id) {
				this.id = id;
			}

			public String getName() {
				return name;
			}

			public void setName(String name) {
				this.name = name;
			}

			public String getPhone() {
				return phone;
			}

			public void setPhone(String phone) {
				this.phone = phone;
			}

			public int getProvince_id() {
				return province_id;
			}

			public void setProvince_id(int province_id) {
				this.province_id = province_id;
			}

			public int getCity_id() {
				return city_id;
			}

			public void setCity_id(int city_id) {
				this.city_id = city_id;
			}

			public int getRegion_id() {
				return region_id;
			}

			public void setRegion_id(int region_id) {
				this.region_id = region_id;
			}

			public String getPname() {
				return pname;
			}

			public void setPname(String pname) {
				this.pname = pname;
			}

			public String getCname() {
				return cname;
			}

			public void setCname(String cname) {
				this.cname = cname;
			}

			public String getRname() {
				return rname;
			}

			public void setRname(String rname) {
				this.rname = rname;
			}

			public String getDetail() {
				return detail;
			}

			public void setDetail(String detail) {
				this.detail = detail;
			}

			public int getUser_id() {
				return user_id;
			}

			public void setUser_id(int user_id) {
				this.user_id = user_id;
			}

			public int getCreatetime() {
				return createtime;
			}

			public void setCreatetime(int createtime) {
				this.createtime = createtime;
			}

			public String getIs_default() {
				return is_default;
			}

			public void setIs_default(String is_default) {
				this.is_default = is_default;
			}

			@Override
			public int describeContents() {
				return 0;
			}

			@Override
			public void writeToParcel(Parcel dest, int flags) {
				dest.writeInt(this.id);
				dest.writeString(this.name);
				dest.writeString(this.phone);
				dest.writeInt(this.province_id);
				dest.writeInt(this.city_id);
				dest.writeInt(this.region_id);
				dest.writeString(this.pname);
				dest.writeString(this.cname);
				dest.writeString(this.rname);
				dest.writeString(this.detail);
				dest.writeInt(this.user_id);
				dest.writeInt(this.createtime);
				dest.writeString(this.is_default);
			}

			public AddressBean() {
			}

			protected AddressBean(Parcel in) {
				this.id = in.readInt();
				this.name = in.readString();
				this.phone = in.readString();
				this.province_id = in.readInt();
				this.city_id = in.readInt();
				this.region_id = in.readInt();
				this.pname = in.readString();
				this.cname = in.readString();
				this.rname = in.readString();
				this.detail = in.readString();
				this.user_id = in.readInt();
				this.createtime = in.readInt();
				this.is_default = in.readString();
			}

			public static final Creator<AddressBean> CREATOR = new Creator<AddressBean>() {
				@Override
				public AddressBean createFromParcel(Parcel source) {
					return new AddressBean(source);
				}

				@Override
				public AddressBean[] newArray(int size) {
					return new AddressBean[size];
				}
			};
		}

		@Override
		public int describeContents() {
			return 0;
		}

		@Override
		public void writeToParcel(Parcel dest, int flags) {
			dest.writeList(this.address);
		}

		public DataBean() {
		}

		protected DataBean(Parcel in) {
			this.address = new ArrayList<AddressBean>();
			in.readList(this.address, AddressBean.class.getClassLoader());
		}

		public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
			@Override
			public DataBean createFromParcel(Parcel source) {
				return new DataBean(source);
			}

			@Override
			public DataBean[] newArray(int size) {
				return new DataBean[size];
			}
		};
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.code);
		dest.writeString(this.msg);
		dest.writeString(this.time);
		dest.writeParcelable(this.data, flags);
	}

	public AddressListData() {
	}

	protected AddressListData(Parcel in) {
		this.code = in.readInt();
		this.msg = in.readString();
		this.time = in.readString();
		this.data = in.readParcelable(DataBean.class.getClassLoader());
	}

	public static final Parcelable.Creator<AddressListData> CREATOR = new Parcelable.Creator<AddressListData>() {
		@Override
		public AddressListData createFromParcel(Parcel source) {
			return new AddressListData(source);
		}

		@Override
		public AddressListData[] newArray(int size) {
			return new AddressListData[size];
		}
	};
}
